package com.ruoyi.kaifa.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kaifa.mapper.ACarouselMapper;
import com.ruoyi.kaifa.domain.ACarousel;
import com.ruoyi.kaifa.service.IACarouselService;

/**
 * 轮播图Service业务层处理
 * 
 * @author 李咨辰
 * @date 2024-09-30
 */
@Service
public class ACarouselServiceImpl implements IACarouselService 
{
    @Autowired
    private ACarouselMapper aCarouselMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public ACarousel selectACarouselById(Long id)
    {
        return aCarouselMapper.selectACarouselById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param aCarousel 轮播图
     * @return 轮播图
     */
    @Override
    public List<ACarousel> selectACarouselList(ACarousel aCarousel)
    {
        return aCarouselMapper.selectACarouselList(aCarousel);
    }

    /**
     * 新增轮播图
     * 
     * @param aCarousel 轮播图
     * @return 结果
     */
    @Override
    public int insertACarousel(ACarousel aCarousel)
    {
        aCarousel.setCreateTime(DateUtils.getNowDate());
        return aCarouselMapper.insertACarousel(aCarousel);
    }

    /**
     * 修改轮播图
     * 
     * @param aCarousel 轮播图
     * @return 结果
     */
    @Override
    public int updateACarousel(ACarousel aCarousel)
    {
        aCarousel.setUpdateTime(DateUtils.getNowDate());
        return aCarouselMapper.updateACarousel(aCarousel);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteACarouselByIds(Long[] ids)
    {
        return aCarouselMapper.deleteACarouselByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteACarouselById(Long id)
    {
        return aCarouselMapper.deleteACarouselById(id);
    }
}
